package com.pg.agent.engine.client.component;

import com.pg.agent.engine.client.bo.InterfaceBO;
import com.pg.agent.engine.client.model.agent.AIAgent;
import com.pg.agent.engine.client.model.llm.CallLog;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

import java.io.Serializable;
import java.util.List;

/**
 * API组件
 *
 * @author huhuaping
 * @date 2023/11/15 10:26
 */
@Slf4j
@Data
public class APIComponent implements ToolComponent, Serializable {

    private static final long serialVersionUID = 9120606095133429204L;

    private Long id;

    private String url;
    private String requestMethod;
    private String inParam;
    private String headerParam;
    private String adapterParam;
    private String name;
    private String code;
    private String description;

    /**
     * 组件提示词指令
     */
    private String promptContent;

    /**
     * 接口列表
     */
    private String interfaceList;

    private List<InterfaceBO> interfaceBOList;

    /**
     * 表达式
     */
    private String elExpress;

    /**
     * 出参
     */
    private String outParam;

    /**
     * 是否流式 0不是，1：是流式
     */
    private Integer type;

    /**
     * 配置方式，1.接口，2.系统函数
     */
    private Integer configureType;

    /**
     * 系统函数
     */
    private SystemFunc systemFunc;

    /**
     * 是否需要重复执行
     */
    private boolean repeat;

    /**
     *返回类型 1.直接返回 2.组件执行顺序返回
     */
    private Integer returnType;


    /**
     * Agent调用大模型组件
     */
    private AgentComponentLLM componentLLM;


    @Override
    public String func(AIAgent agent, CallLog comCallInfo, String argument) {
        return null;
    }
}
